import 'package:get/get.dart';
import 'package:study_demo/base/base_chess_controller.dart';
import 'package:study_demo/ext/tile_ext.dart';
import 'package:terms/terms.dart';

import '../../base/count_controller.dart';
import '../../base/situation_controller.dart';

class GoTermsController extends BaseChessController {
  final terms = '棋'.obs;

  @override
  boardChanged(BoardFrame frame, BoardChange boardChanged) {
    super.boardChanged(frame, boardChanged);
    print('棋子变化了');
    if (boardChanged.selfNewChess && boardChanged.addNum > 0) {
      terms.value = chessDescription(board, type: 1);
    }
  }

  regret() {
    board.clearFlag();
    board.regret(1, refreshUI: true);
  }

  count() {
    countByServer(board).then((value) {});
  }

  situation() {
    getSituation(board).then((value) {});
  }
}
